trigger FraudLowestStatusValue on Opportunity (after insert,after update) {
    Set<string> accId = new Set<string>();
    string recordTypeId = Schema.sObjectType.Opportunity.getRecordTypeInfosByName().get('West - Student Application').getRecordTypeId();
    for(Opportunity o:Trigger.new) {
    	system.debug(Trigger.new.size());
    	system.debug(o.Status_Fraud_Value__c);
    	
        if(o.RecordTypeId == recordTypeId) {
        	system.debug('o.rec11');
        	if(Trigger.isUpdate){
            	if(o.Status_Fraud_Value__c != Trigger.oldMap.get(o.id).Status_Fraud_Value__c) {
                	accId.add(o.AccountId);
                	system.debug(o.AccountId);
            	}
            }
            else if(Trigger.isInsert)
            	accId.add(o.AccountId);
        }
    }
    system.debug('FraudLowestStatusValue 11');
    system.debug(accId.size());
    if(accId.size() >0) {
        Map<Id,Opportunity> updAcc = Fraud_LowestOppIdInAccount.updateAccountFieldLSV(accId);
    	system.debug('FraudLowestStatusValue 22');
        List<Account> acc = new List<Account>();
        for(Opportunity o1: updAcc.values()) {
        	system.debug('FraudLowestStatusValue 33');
            Account a = o1.Account;         
            a.OppyIdWithLowestStatusValue__c = o1.Id;
            acc.add(a);
        }
        update acc;
    }
    
}